﻿using PmpNetwork.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace PmpNetwork.ViewModels
{
    public class QuestionOptionViewModel
    {
        public int? Id { get; set; }
        public int? QuestionId { get; set; }
        public string Text { get; set; }
        public int? DisplayIndex { get; set; }
        public bool? IsCorrect { get; set; }
        public bool? IsSelected { get; set; }

        public void Fill(WikiQuestionOptionPart part)
        {
            if (this.Text != null && !this.Text.Equals(part.Text))
            {
                part.Text = this.Text;
            }

            if (this.DisplayIndex != null && !this.DisplayIndex.Equals(part.DisplayIndex))
            {
                part.DisplayIndex = this.DisplayIndex.Value;
            }

            if (this.IsCorrect != null && !this.IsCorrect.Equals(part.IsCorrect))
            {
                part.IsCorrect = this.IsCorrect.Value;
            }
        }
    }
}